<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
    // console.dir(Function.prototype)


    // 1.arguments
    function test() {
      console.log(arguments)
    }
    test(1, 2, {name: "wang"})


    // 2.bind, call, apply
    function hello () {  // window.hello
      console.log(this)
      console.log(arguments)
    }

    console.log(window.hello)
    hello.call("123", 1, 2, 3)
    hello.apply("456", [4, 5, 6])
    hello.bind("789", "a", "b", "c")("hgaha")

    // new Function
    const func = new Function("a", "b", "return a + b")
    func.name = "func"
    console.dir(func)
  </script>
</body>
</html>
